package com.qwt.part_time_api.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qwt.part_time_api.mapper.TypeMapper;
import com.qwt.part_time_api.pojo.Type;
import com.qwt.part_time_api.service.TypeService;
import com.qwt.part_time_api.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 君子慎独
 * @create 2021/12/25 0025 20:46
 */
@Service
@Slf4j
public class TypeServiceImpl implements TypeService {

    @Autowired
    private TypeMapper typeMapper;

    @Override
    public Result findAllType() {
        log.info("查询所有类型");
        LambdaQueryWrapper<Type> wrapper = new LambdaQueryWrapper<>();
        List<Type> types = typeMapper.selectList(wrapper);
        return Result.success(types);
    }
}
